home *** CD-ROM | disk | FTP | other *** search
- class com.ndimedia.ui.BitmapText extends com.ndimedia.ui.UIObject
- {
- var m_scope;
- var m_text;
- var m_font;
- var m_xoffset;
- var m_yoffset;
- var m_view;
- function BitmapText(scope, text, font)
- {
- super();
- this.m_scope = scope;
- this.m_text = text;
- this.m_font = font;
- this.m_xoffset = 0;
- this.m_yoffset = 0;
- this.m_view = new com.ndimedia.containers.View(scope);
- var _loc6_ = this.m_view.graphics;
- var _loc5_ = 0;
- while(_loc5_ < this.m_text.length)
- {
- var _loc3_ = this.m_text.charAt(_loc5_);
- if(_loc3_ == "0" || _loc3_ == 0)
- {
- _loc3_ = "zero";
- }
- if(_loc3_ == "\n")
- {
- this.m_xoffset = 0;
- this.m_yoffset += this.m_font.height;
- }
- else if(_loc3_ == " ")
- {
- this.m_xoffset += this.m_font.space + this.m_font.kerning;
- }
- else
- {
- var _loc4_ = this.m_font.draw(_loc6_,_loc3_);
- _loc4_._x = this.m_xoffset;
- _loc4_._y = this.m_yoffset;
- this.m_xoffset += _loc4_._width + this.m_font.kerning;
- }
- _loc5_ = _loc5_ + 1;
- }
- this.m_view.show();
- }
- function move(x, y)
- {
- this.m_view.move(x,y);
- }
- }
-